VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CXmlAttribute"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit

Public KeyWord As String
Public Value As String

Friend Function Serialize() As String
    Serialize = KeyWord & "='" & Value & "'"
End Function

Friend Sub Parse(Data() As Byte, Start As Long, lp As Long)
    Dim bData As Boolean
    
    On Error GoTo Err_Trap
    
    Do
        Select Case Data(Start)
            ' White Space
            Case ascSpace, ascTab, ascCr, ascLf
                ' Ignore unless We have alreadt fetched a value
                
            ' Starting Letter Characetrs
            Case ascUpperFirst To ascUpperLast, _
                 ascLowerFirst To ascLowerLast, _
                 ascUnderScore, ascColon
                
                If Not ParseName(Data(), Start, lp, KeyWord) Then GoTo Err_Trap
                Start = Start - 1
                
            ' Quote Characters
            Case ascQuote, ascApos
                Value = ParseValue(Data(), Start)
                Exit Do
                
        End Select
        Start = Start + 1
    Loop
Exit Sub

Err_Trap:
    Select Case Err.Number
        ' Exceptions Raised:
        Case 9
            'Unexpected End of Data [array index out of bounds]
            Err.Raise vbObjectError Or Err.Number, "Parse", "Unexpected end of data", vbNullString, 0
            
        ' Exceptions Forwarded:
        Case vbObjectError Or 9
            'ParseName Exceptions
            'ParseValue Exceptions
            Err.Raise Err.Number
        
        Case Else
        ' ToDo . . . Log All Other Errors
    
    End Select
End Sub

